package com.xiaoq;

import java.text.MessageFormat;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component("mailDeliverReceiver")
public class MailDeliverReceiver extends AbstractReceiver {
	private static final Logger LOG = LoggerFactory.getLogger(MailDeliverReceiver.class);
	@Override
	public void execute(String message) {
		LOG.info(MessageFormat.format("[DELIVER] [MAIL] [QUEUE] 收到消息, {0}", message));

		try {
			LOG.info(message);
		} catch (Exception e) {
			String msg = "[DELIVER] [MAIL] [QUEUE] 消息解析错误";
			LOG.error(msg, e);
			throw new RuntimeException(msg, e);
		}
		
		LOG.info("[DELIVER] [MAIL] [QUEUE] 消息解析完毕");

		
		LOG.info("[DELIVER] [MAIL] [QUEUE] 接收消息处理完毕");
	}
}